/*
 * @Author: 清羽
 * @Date: 2022-12-08 17:44:46
 * @LastEditTime: 2022-12-09 15:47:58
 * @LastEditors: you name
 * @Description: 
 */
import request from '@/utils/request'
import { admin } from '@/utils/base'

const category = {
	// 获取分类列表
	getCategories () {
		return request({
			url: `${admin}/categories`,
			method: 'get'
		})
	},

	// 添加分类
	addCategory (data) {
		return request({
			url: `${admin}/category/add`,
			method: 'post',
			data
		})
	},

	// 修改分类名称
	updateCategory (data) {
		return request({
			url: `${admin}/category/update`,
			method: 'post',
			data
		})
	},

	// 删除分类
	deleteCategory (data) {
		return request({
			url: `${admin}/category/delete`,
			method: 'post',
			data
		})
	}
}

export default category